<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var res = [20, 40, 100, 250]

        function map(arr) {
            var arr1 = [] //创建一个空数组接收增加后的数值
            for (var i = 0; i < arr.length; i++) {
                // arr[i] = arr[i] * 1.3 //增加30%，并赋值给自身
                // arr1[i] = arr[i] //赋值给新的空数组i
                arr1.push(arr[i] * 1.3)
            }
            return arr1
        }
        console.log(map(res))
    </script>
</body>

</html>